<?php
/**
* @name church.php
* @copyright (c) 2011
* @author Arsene Tochemey GANDOTE<arsene.gandote@yahoo.com>
*/
class Organisation extends AppModel {
	# Model name
	var $name = 'Organisation';
	# Display field
	var $displayField = 'name';
	# validation rules

	# Methods to interact with the database table churches via the model Church
	/**
	* This function is used to retrieve the church data from the database table churches
	* @name getChurchData
	* @param void
	* @return Array containing the church data
	* @access public
	*/
	function getData(){
		# fetch the church data and return the data
		return $this->find('first');
	}

	/**
	* This function retrieves the church name from the database table churches
	* @name getChurchName
	* @param void
	* @var Array $fields Array containing the fields to retrieve from the database table churches.
	* @var Array $result Array containing the resultset of the query sent to the database.
	* @return string containing the church name to retrieve.
	* @access public
	*/
	function getName(){
		# field to retrieve
		$fields = array('name');
		# retrieve the field and return the data
		$result = $this->find('first', array(
			'fields' => $fields
		));
		return $result['Organisation']['name'];
	}


    function getOrgInfo(){
        # retrieve the field and return the data
        $result = $this->find('first', array(
            'recursive' => -1
        ));
        return $result['Organisation'];
    }
}